home *** CD-ROM | disk | FTP | other *** search
- Option Explicit
-
- Global Const FRAME_SIZE = 3
-
- Sub LoadFrame ()
- Dim lname As Variant, class As Variant
- Dim r As Integer, c As Integer, temp As Integer
- Dim Breakout As Integer
- Dim C1Width As Integer, C2Width As Integer
-
- Const DELTA = 125
-
- On Error Resume Next
-
- 'Establish a size for the grid.
- Form2.Grid1.Rows = FRAME_SIZE + 1
- Form2.Grid1.ColWidth(1) = 1365
- Form2.Grid1.ColWidth(2) = 1500
-
- 'Clear out the current grid contents.
- For r = 1 To FRAME_SIZE
- Form2.Grid1.Row = r
- 'Hit all three columns.
- For c = 0 To 2
- Form2.Grid1.Col = c
- Form2.Grid1.Text = ""
- Next c
- Next r
-
- 'Set the column headings
- Form2.Grid1.Row = 0
- Form2.Grid1.Col = 1
- Form2.Grid1.Text = form1.Data1.Recordset.Fields("Name").Name
- Form2.Grid1.Col = 2
- Form2.Grid1.Text = form1.Data1.Recordset.Fields("class").Name
-
- For r = 1 To FRAME_SIZE
- Form2.Grid1.Row = r
-
- 'Get student ID#
- Form2.Grid1.Col = 0
- Form2.Grid1.Text = form1.Data1.Recordset!Scount
-
- 'Get name
- Form2.Grid1.Col = 1
- lname = form1.Data1.Recordset!Name
- Form2.Grid1.Text = lname
-
- 'Get class
- Form2.Grid1.Col = 2
- class = form1.Data1.Recordset!class
- Form2.Grid1.Text = class
-
- 'If it's not the last iteration of this loop, attempt to
- 'move to the next record. If an error occurs, the program
- 'will leave this loop.
- If r <> FRAME_SIZE Then
- form1.Data1.Recordset.MoveNext
- If form1.Data1.Recordset.EOF Then
- Exit For
- End If
- End If
-
- Next r
-
- 'These constants, arrived at experimentally, size the
- 'grid box appropriately.
- Const G_HEIGHT = 60
- Const G_WIDTH = 310
-
- Form2.Grid1.Height = (FRAME_SIZE + 1) * (Form2.Grid1.RowHeight(1) + G_HEIGHT)
-
- End Sub
-
-